class Person {
    public String name;//姓名
    public int age;//年龄
    public void eat() {
        System.out.println(name+" 正在吃饭！");
    }
    public void show() {
        System.out.println("姓名："+name+" 年龄："+age);
    }
}
public class Test {
    public static void main1(String[] args) {
        Person person1 = new Person();
        person1.name = "zhangsan";
        person1.age = 10;
        System.out.println(person1.name);
        System.out.println(person1.age);
        person1.show();

        System.out.println("===============");
        Person person2 = new Person();
        person2.name = "lisi";
        person2.age = 19;
        System.out.println(person2.name);
        System.out.println(person2.age);
        person2.show();
    }

    public static void main2(String[] args) {
        //代表person1 不指向任何对象
        Person person1 = null;
        person1.name = "zhangsan";
        person1.age = 10;
        person1.show();
    }

    //引用指向引用 的例子：这个说法是不对的
    public static void main3(String[] args) {
        Person person1 = new Person();
        Person person2 = new Person();
        person1 = person2;
    }

    public static void main(String[] args) {
        Person person1 = new Person();
        person1 = new Person();
        person1 = new Person();
        person1 = new Person();
        person1 = new Person();
        person1 = new Person();

    }




}
